package com.dhcc.DRGsHosp.facade.impl.assembler;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import com.dhcc.DRGsHosp.core.domain.QuotaExpected;
import com.dhcc.DRGsHosp.facade.dto.QuotaExpectedDTO;

public class QuotaExpectedAssembler {
	
	public static QuotaExpectedDTO  toDTO(QuotaExpected  qo){
		if (qo == null) {
			return null;
		}
    	QuotaExpectedDTO result  = new QuotaExpectedDTO();
        	    result.setExpectedId (qo.getExpectedId());
     	    	result.setVersion (qo.getVersion());
     	    	result.setParQuotaCode (qo.getParQuotaCode());
     	    	result.setExpectedValue (qo.getExpectedValue());
     	    	result.setExpectedYear(qo.getExpectedYear());
     	    	result.setReume(qo.getReume());
     	    	result.setObjType(qo.getObjType());
     	    	result.setVersion(qo.getObjType());
     	    	result.setRoleName(qo.getRoleName());
     	    return result;
	 }
	
	public static List<QuotaExpectedDTO>  toDTOs(Collection<QuotaExpected>  quotaExpecteds){
		if (quotaExpecteds == null) {
			return null;
		}
		List<QuotaExpectedDTO> results = new ArrayList<QuotaExpectedDTO>();
		for (QuotaExpected each : quotaExpecteds) {
			results.add(toDTO(each));
		}
		return results;
	}
	
	 public static QuotaExpected  toEntity(QuotaExpectedDTO  qo){
	 	if (qo == null) {
			return null;
		}
	 	QuotaExpected result  = new QuotaExpected();
	        result.setExpectedId(qo.getExpectedId());
	    	result.setVersion (qo.getVersion());
	    	result.setParQuotaCode (qo.getParQuotaCode());
	    	result.setExpectedValue (qo.getExpectedValue());
	    	result.setExpectedYear(qo.getExpectedYear());
	    	result.setReume(qo.getReume());
	    	result.setObjType(qo.getObjType());
	    	result.setVersion(qo.getObjType());
	    	result.setRoleName(qo.getRoleName());
 	  	return result;
	 }
	
	public static List<QuotaExpected> toEntities(Collection<QuotaExpectedDTO> quotaExpectedDTOs) {
		if (quotaExpectedDTOs == null) {
			return null;
		}
		
		List<QuotaExpected> results = new ArrayList<QuotaExpected>();
		for (QuotaExpectedDTO each : quotaExpectedDTOs) {
			results.add(toEntity(each));
		}
		return results;
	}
}
